using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cysharp.Threading.Tasks;
using System;

public class SeventTeen : MonoBehaviour
{
    private async void Start()
    {
        var uniTaskCompletionSource = new UniTaskCompletionSource<string>();
        var task = uniTaskCompletionSource.Task;

        // uniTaskCompletionSource.TrySetResult("任务完成");//???
        //
        // var result = await task;
        //
        // Debug.Log(result);


        uniTaskCompletionSource.TrySetCanceled();//????

        try
        {
            await task;
        }
        catch (OperationCanceledException)
        {
            Debug.Log("任务取消");
        }
    }
}